/*
 * 文 件 名:  ServiceConstants.java
 * 版    权:  深圳埃思欧纳信息咨询有限公司版权所有. YYYY-YYYY,  All rights reserved
 * 描    述:  <描述>
 * 修 改 人:  Administrator
 * 修改时间:  2010-3-15
 * 跟踪单号:  <跟踪单号>
 * 修改单号:  <修改单号>
 * 修改内容:  <修改内容>
 */
package com.velocity;

import java.util.HashMap;

import com.ue.data.DBManager;
import com.ue.data.DataSourceFactory;
import com.ue.data.DataTable;
import com.ue.data.IDataSource;
import com.ue.data.Sql;

/**
 * <业务操作常量类> <功能详细描述>
 * 
 * @author Eric.Zhang
 * @version [Aceona2.0, 2010-3-15]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class ServiceConstants
{
    /** 老系统地址 */
    public static String ACEONA10PATH = "";

    /** 新系统地址 */
    public static String ACEONA20PATH = "";

    /** 文件服务器地址 */
    public static String FILE_SERVER = "";

    /** 消息中心地址 */
    public static String IPC_URL = "";

    /** 动态地址 */
    public static String FEEDS_URL = "";

    /**
     * 手机短信息地址
     */
    public static String SMS_URL = "";

    /** 搜索接口地址 */
    public static String SEARCH_URL = "";
    
    /** 发送未激活用户邮件接口地址 */
    public static String ACTIVATEEMAIL_URL = "";

    /** 后台登陆地址 */
    public static String MANAGE_SYSTEM_LOGIN_PATH = "";

    /** 支付宝主动通知URL */
    public static String ALIPAY_NOTIFY_URL = "";

    /** 支付宝返回通知URL */
    public static String ALIPAY_RETURN_URL = "";

    /** 支付宝合作ID */
    public static String ALIPAY_PARTNER_ID = "";

    /** 支付宝密钥 */
    public static String ALIPAY_PRIVATE_KEY = "";

    /** 支付宝账号 */
    public static String ALIPAY_EMAIL = "";

    /** q提供的hessian接口*/
    public static String HESSIAN_Q = "";
    
    static
    {
        HashMap<String, String> zone_service_config = new HashMap<String, String>();
        IDataSource sqlDataSource = DataSourceFactory.create(ServiceConstants.DS_8888889_IPC);

        Sql sql = (Sql) (sqlDataSource.getSelectCommands().get("getServiceConfl"));
        /** 设置数据库连接 */
        sql.setConnectionKey(ServiceConstants.DB_OLD_NAME);

        DataTable dt = DBManager.getDataTable(sql);
        for (int i = 0; i < dt.getRows().size(); i++)
        {
            zone_service_config.put(dt.getRow(i).getString("configName"), dt.getRow(i).getString("configValue"));
        }
        ACEONA10PATH = zone_service_config.get("Aceona1_0Domain");
        ACEONA20PATH = zone_service_config.get("Aceona2_0Domain");
        FILE_SERVER = zone_service_config.get("file_server");
        IPC_URL = zone_service_config.get("IPC_URL");
        FEEDS_URL = zone_service_config.get("feeds_url");
        HESSIAN_Q = zone_service_config.get("HESSIAN_Q");
        SMS_URL = zone_service_config.get("SMS_URL");
        SEARCH_URL = zone_service_config.get("SEARCH_URL");
        ACTIVATEEMAIL_URL = zone_service_config.get("activateEmail_URL");
        MANAGE_SYSTEM_LOGIN_PATH = ACEONA10PATH + "opmg";

        ALIPAY_NOTIFY_URL = zone_service_config.get("alipay_Notify_URL");
        ALIPAY_RETURN_URL = zone_service_config.get("alipay_Return_URL");
        ALIPAY_PARTNER_ID = zone_service_config.get("alipay_Partner_ID");
        ALIPAY_PRIVATE_KEY = zone_service_config.get("alipay_Private_Key");
        ALIPAY_EMAIL = zone_service_config.get("alipay_Email");
    }

    /********** 神奇的 积分/规则表达式模块定义分隔线 start by Eric 20100316 *****************/
    /** 规则表达式模块Cache */
    public static final String RULEENGINECACHE = "zone_ruleEngineCache";

    /** 表达式在Cache中key值 */
    public static final String DT_ALL_RULES = "all_rules";

    /** 表达式在Cache中key值 */
    public static final String ALLVARRULE = "allvars";

    /** 1,用户积分改变单位,2,用户AB改变单位 3,用户经验值改变单位 */
    public static final String UNIT_USER_INTEGRAL = "1";

    /** 1,用户积分改变单位,2,用户AB改变单位 3,用户经验值改变单位 */
    public static final String UNIT_ACE_COIN = "2";

    /** 1,用户积分改变单位,2,用户AB改变单位 3,用户经验值改变单位 */
    public static final String UNIT_USER_EXP = "3";

    /** 积分或A币，经验值变化类型，0:扣除 1:获取 */
    public static final String VALUE_CHANGE_TYPE_0 = "0";

    /** 积分或A币，经验值变化类型，0:扣除 1:获取 */
    public static final String VALUE_CHANGE_TYPE_1 = "1";

    /** 积分值变化 */
    public static final String JF_CHANGE = "zone_integral_change_value";

    /** 规则引擎用户ID */
    public static final String ENGINE_USER_ID = "engine_user_id";

    /** 规则引擎圈子ID */
    public static final String ENGINE_ZONEGROUP_ID = "engine_zone_group_id";

    /** 对应数据库中配置用户积分表达式 */
    public static final String ENGINE_RULE_USERJF = "UserJF";

    /** 对应数据库中配置用户A币表达式 */
    public static final String ENGINE_RULE_USERAB = "UserAB";

    /** 对应数据库中配置用户经验表达式 */
    public static final String ENGINE_RULE_USEREXP = "UserEXP";

    /** 用户简历状态0初始状态 */
    public static final String USER_RESUME_STATUS_0 = "0";

    /** 用户简历状态1合格 */
    public static final String USER_RESUME_STATUS_1 = "1";

    /** 用户简历Y */
    public static final String Y_STR = "Y";

    /** 用户简历N */
    public static final String N_STR = "N";

    /********** 神奇的 积分/规则表达式模块定义分隔线 end by Eric 20100318 *****************/

    public static final String DB_OLD_NAME = "aceona_old";

    public static final String DB_ZONE_NAME = "me1";

    public static final Long USER_CENTER_SQL_ID = 1L;

    /********** 朋友管理 by jacky 为了兼容老系统 顺序杂乱 *****************/

    /** 我的好友关系 待审核 */
    public static final String ZONE_FRIEND_WAIT_VERIFY = "0";

    /** 我的好友关系 已查阅信息 */
    public static final String ZONE_FRIEND_ALREADY_READ = "1";

    /** 我的好友关系 审核通过 */
    public static final String ZONE_FRIEND_VERIFY_PASS = "2";

    /** 我的好友关系 审核拒绝 */
    public static final String ZONE_FRIEND_VERIFY_NOPASS = "3";

    /** 我的好友关系 好友屏蔽 */
    public static final String ZONE_FRIEND_BLACK = "1";

    /********** 数据库模块定义分隔线 start by Eric 20100330 *****************/
    /* 数据源表g_datasource对应id值 */
    public static final long DS_1_USERINFO = 1;

    public static final long DS_2_DICTIONARY = 2;

    public static final long DS_3_POSTINFO = 3;

    public static final long DS_4_SEARCHTEST = 4;

    public static final long DS_5_EXAMPLE = 5;

    public static final long DS_6_ZONE = 6;

    public static final long DS_7_ALBUM = 7;

    public static final long DS_8_ZONE_POSTINFO = 8;

    public static final long DS_9_ZONE_USERMGT = 9;

    public static final long DS_10_COMMENT = 10;

    public static final long DS_11_ZONE_TRADE = 11;

    public static final long DS_12_INTEGRATION = 12;

    public static final long DS_13_ZONEROLE = 13;

    public static final long DS_14_ZONE_VIDEO = 14;

    public static final long DS_15_GOODSMGT = 15;

    public static final long DS_16_GPURCHASEMGT = 16;

    public static final long DS_17_ARTICLEMGT = 17;

    public static final long DS_18_ZONE_INDEX = 18;

    public static final long DS_19_VOTEMGT = 19;

    public static final long DS_20_ZONE_PERSONAL = 20;

    public static final long DS_21_FRIENDSMGT = 21;

    public static final long DS_22_RESUMESHAREMGT = 22;

    public static final long DS_23_PUBNOTICE = 23;

    public static final long DS_24_ZONEDISMERGE = 24;

    public static final long DS_28_REPORTMGT = 28;

    public static final long DS_30_ACTIVITYMGT = 30;

    public static final long DS_33_QUESTIONNAIRE = 33;

    public static final long DS_34_HITS = 34;

    public static final long DS_36_HOTJOB = 36;

    public static final long DS_37_PROUSER = 37;

    public static final long DS_38_PUBLISHPOST = 38;

    public static final long DS_39_RECHARGE = 39;
    
    public static final long DS_40_GROUPSHARE = 40;

    public static final long DS_8888889_IPC = 8888889;

    public static final String DS_USER_ROLE = "user_role";

    public static final String DS_CORP_BILL = "corp_bill";

    public static final String DS_RECOMMEND_REPORT = "recommend_report";

    public static final String DS_USER_RECOMMEND_REPORT = "userrecommend_report";

    public static final String DS_BACKLOG = "backlog";

    public static final String DS_AD_SCHEDULED = "ad_scheduled";

    public static final String DS_REMARK = "remark";

    public static final String DS_CONTRACT = "contract";

    public static final String DS_EDM = "edm";
    
    public static final String DS_SEND_INFORMATION = "send_information";

    /** 用户账户管理 */
    public static final String DS_ACCOUNT_IPC = "account";
    
  //2011/1/24 圈子信息预约发布 add by yujj begin-->
    /**圈子信息预约发布用SQL **/
    public static final String DS_ZONE_PUBLISH = "zone_publish";
  //2011/1/24 圈子信息预约发布 add by yujj end<--


    /********** 数据库模块定义分隔线 End by Eric 20100330 *****************/

    /********** 支付模块定义分隔线 start by Eric 20100401 *****************/
    public static final String GPUR_PREPAYMENT = "1";

    /** 支付表记录支付类型,1,A币交易，2,积分 */
    public static final String PAYTYPE_AB = "1";

    /** 支付表记录支付类型,1,A币交易，2,积分 */
    public static final String PAYTYPE_INTEGRAL = "2";

    /** 支付表记录支付状态,交易状态:0,失败,1,成功 */
    public static final String PAYTYPE_STATUS_FAIL = "0";

    /** 支付表记录支付类型,交易状态:0,失败,1,成功 */
    public static final String PAYTYPE_STATUS_SUCCESS = "1";

    /** 支付表记录交易来源,1,拼购,2,圈子交易,3,礼品兑换 */
    public static final String PAYTYPE_SOURCE_GPURCHASE = "1";

    /** 支付表记录交易来源,1,拼购,2,圈子交易,3,礼品兑换 */
    public static final String PAYTYPE_SOURCE_ZONETRADE = "2";

    /** 支付表记录交易来源,1,拼购,2,圈子交易,3,礼品兑换 */
    public static final String PAYTYPE_SOURCE_GOODSEXCHANGE = "3";

    /********** 支付模块定义分隔线 end by Eric 20100401 *****************/

    /********** 用户拼购模块定义分隔线 start by Eric 20100401 *****************/
    /** 拼购状态 0:拼购失败 1:已付订金 2:已付全额 3:已发货 4:已收货 5:已退款 */
    public static final String USER_GPUR_0 = "0";

    /** 拼购状态 0:拼购失败 1:已付订金 2:已付全额 3:已发货 4:已收货 5:已退款 */
    public static final String USER_GPUR_1 = "1";

    /** 拼购状态 0:拼购失败 1:已付订金 2:已付全额 3:已发货 4:已收货 5:已退款 */
    public static final String USER_GPUR_2 = "2";

    /** 拼购状态 0:拼购失败 1:已付订金 2:已付全额 3:已发货 4:已收货 5:已退款 */
    public static final String USER_GPUR_3 = "3";

    /** 拼购状态 0:拼购失败 1:已付订金 2:已付全额 3:已发货 4:已收货 5:已退款 */
    public static final String USER_GPUR_4 = "4";

    /** 拼购状态 0:拼购失败 1:已付订金 2:已付全额 3:已发货 4:已收货 5:已退款 */
    public static final String USER_GPUR_5 = "5";

    /** 拼购状态 0:发布 1:确认 2:成功 3:失败 4:下线 */
    public static final String GROUP_PURCHASE_STATUS_0 = "0";

    /** 拼购状态 0:发布 1:确认 2:成功 3:失败 4:下线 */
    public static final String GROUP_PURCHASE_STATUS_1 = "1";

    /** 拼购状态 0:发布 1:确认 2:成功 3:失败 4:下线 */
    public static final String GROUP_PURCHASE_STATUS_2 = "2";

    /** 拼购状态 0:发布 1:确认 2:成功 3:失败 4:下线 */
    public static final String GROUP_PURCHASE_STATUS_3 = "3";

    /** 拼购状态 0:发布 1:确认 2:成功 3:失败 4:下线 */
    public static final String GROUP_PURCHASE_STATUS_4 = "4";

    /********** 支付模块定义分隔线 end by Eric 20100401 *****************/

    /** 相册权限,权限类型,1,所有人,2,圈内 */
    public static final String ALBUM_PERMISSION_1 = "1";

    /** 相册权限,权限类型,1,所有人,2,圈内 */
    public static final String ALBUM_PERMISSION_2 = "2";

    /** 圈子估值、流动资金单位 1:流动资金 2:估值 */
    public static final String ZONE_UNIT_1 = "1";

    /** 圈子估值、流动资金单位 1:流动资金 2:估值 */
    public static final String ZONE_UNIT_2 = "2";

    public static final String ASSIGN_ROLE_ID_SALEINGUSER = "1";

    public static final String ASSIGN_ROLE_ID_SALEAFTERUSER = "2";

    public static final String ASSIGN_ROLE_ID_SALEAFTERCSUSER = "3";

    public static final String DS_ASSIGN_CORP = "assigncorp";

    public static final String SIGN_VERIFY_MAIL = "mona.luo@aceona.com";

    // public static final String SIGN_VERIFY_MAIL="felix.huang@aceona.com";

    public static final String CUSTOMER_STATUS_1 = "1";// 待签单

    public static final String CUSTOMER_STATUS_2 = "2";// 已签单

    public static final String CUSTOMER_STATUS_3 = "3";// 已采集

    /**
     * 合同号状态，已生成
     */
    public static final String CONTRACT_ID_STATUS_CREATED = "1";

    /**
     * 合同号状态，已使用
     */
    public static final String CONTRACT_ID_STATUS_USED = "2";

    /**
     * 合同号状态，已作废
     */
    public static final String CONTRACT_ID_STATUS_CANCELED = "3";

    /** 售后分配关联job类型，企业 */
    public static final String JOB_TYPE_CORP = "1";

    /** 售后分配关联job类型，职位 */
    public static final String JOB_TYPE_POST = "2";

    /** 售后分配关联job类型，待BD企业 */
    public static final String JOB_TYPE_BDCORP = "3";

    
    /********信息接收设置管理定义分隔线 start by Honny 20101110*********/
    
    /** 圈主邀请好友加入新创建的圈子*/
    public static final String INVENT_FRIEND_JOIN_NEWZONE ="1";
    
    /** 创建新活动，给圈子成员发短消息*/
    public static final String INVENT_MEMBERS_JOIN_NEWACTIVITY ="2";
    
    /** 有新评论，给作者或者一级评论人发短消息*/
    public static final String NOTICE_SOMEOME_VIEW_NEWCOMMENT ="3";
    
    /** 邀请加入圈子邮件提醒*/
    public static final String INVENT_USER_JOIN_ZONE ="1";
    
    /** 被邀请加为好友邮件提醒*/
    public static final String INVENT_USER_JOIN_FRIEND ="2";
    
    /** 加入圈子审批通过邮件提醒*/
    public static final String APPROVE_PASS_JOIN_ZONE ="3";
    
    /** 创建新活动，给圈子成员发短消息*/
    public static final String APPROVE_PASS_JOIN_FRIEND ="4";
    
    /********信息接收设置管理定义分隔线 end by Honny 20101116*********/
    
    public static final String LOGIN_JSP = "/zh_cn/pvip/login.jsp";
    
    /**圈子分享评论类型*/
    public static final String GSHARECOMMENTTYPE = "6";

}
